package com.atguigu;

import com.atguigu.pojo.User;
import com.atguigu.service.UserService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import javax.xml.transform.Source;
import java.util.List;

@SpringBootTest
public class UserMapperTest3 {
    @Autowired
    private UserService userService;

    @Test
    public void test1(){
        QueryWrapper<User> userQueryWrapper = new QueryWrapper<>();;
        userQueryWrapper.eq("name","xiaohu");
        List<User> list = userService.list(userQueryWrapper);
        System.out.println(list);

    }
    @Test
    public void test2(){
        QueryWrapper<User> userQueryWrapper = new QueryWrapper<>();
        QueryWrapper<User> email = userQueryWrapper.like("email", "baomidou.con");

    }

    @Test
    public void test3(){
        QueryWrapper<User> userQueryWrapper = new QueryWrapper<>();
        userQueryWrapper.orderByDesc("age");

        List<User> list = userService.list(userQueryWrapper);
        System.out.println(list);

    }
}
